/**
 * @param {number[]} candies
 * @param {number} extraCandies
 * @return {boolean[]}
*/
var kidsWithCandies = function(candies, extraCandies) {
  let max = Math.max(...candies), result = new Array(candies.length).fill(false);
  for(let i = 0; i < candies.length; i++) {
    if(candies[i] + extraCandies >= max) result[i] = true;
  }
  return result;
};
let candies = [2,3,5,1,3], extraCandies = 3;
console.log(kidsWithCandies(candies, extraCandies));
candies = [4,2,1,1,2], extraCandies = 1;
console.log(kidsWithCandies(candies, extraCandies));
candies = [12,1,12], extraCandies = 10;
console.log(kidsWithCandies(candies, extraCandies));
